// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env:"cjw12138-4gb2o61v4b4636ac"
})

const db = cloud.database();

// 云函数入口函数
exports.main = async (event, context) => {
  var page = event.page ? event.page: 0;
  return await db.collection("articles").orderBy("postTime","desc").limit(4).skip(page).get();
}